import loginPage from "./login"
import { render } from "vue"

const login = (options) => {
    const mountNode = document.createElement("div")
    if (!options) options = { modelValue: true }
    mountNode.id = "login"
    document.body.appendChild(mountNode)
    const vNode = h(loginPage, {
        ...options, onCancel: () => {
            setTimeout(() => {
                document.body.removeChild(mountNode)
            }, 200);
        }
    })
    render(vNode, mountNode)
}

export default login